Optimal. Leaf size=135 \[ -\frac {7 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{8 \sqrt {a} f}+\frac {9 \cot (e+f x)}{8 f \sqrt {a+a \sin (e+f x)}}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.40, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 7, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {2797, 2728,
212, 3123, 3063, 3064, 2852} \begin {gather*} \frac {9 \cot (e+f x)}{8 f \sqrt {a \sin (e+f x)+a}}-\frac {7 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{8 \sqrt {a} f}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a \sin (e+f x)+a}}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a \sin (e+f x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2797
Rule 2852
Rule 3063
Rule 3064
Rule 3123
Rubi steps
\begin {align*} \int \frac {\cot ^4(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx &=\int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx+\int \frac {\csc ^4(e+f x) \left (1-2 \sin ^2(e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx\\ &=-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}+\frac {\int \frac {\csc ^3(e+f x) \left (-\frac {a}{2}-\frac {7}{2} a \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{3 a}-\frac {2 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}+\frac {\int \frac {\csc ^2(e+f x) \left (-\frac {27 a^2}{4}-\frac {3}{4} a^2 \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{6 a^2}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}+\frac {9 \cot (e+f x)}{8 f \sqrt {a+a \sin (e+f x)}}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}+\frac {\int \frac {\csc (e+f x) \left (\frac {21 a^3}{8}-\frac {27}{8} a^3 \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{6 a^3}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}+\frac {9 \cot (e+f x)}{8 f \sqrt {a+a \sin (e+f x)}}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}+\frac {7 \int \csc (e+f x) \sqrt {a+a \sin (e+f x)} \, dx}{16 a}-\int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}+\frac {9 \cot (e+f x)}{8 f \sqrt {a+a \sin (e+f x)}}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}-\frac {7 \text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{8 f}+\frac {2 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}\\ &=-\frac {7 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{8 \sqrt {a} f}+\frac {9 \cot (e+f x)}{8 f \sqrt {a+a \sin (e+f x)}}+\frac {\cot (e+f x) \csc (e+f x)}{12 f \sqrt {a+a \sin (e+f x)}}-\frac {\cot (e+f x) \csc ^2(e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(292\) vs. \(2(135)=270\).
time = 0.41, size = 292, normalized size = 2.16 \begin {gather*} \frac {\csc ^9\left (\frac {1}{2} (e+f x)\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (36 \cos \left (\frac {1}{2} (e+f x)\right )-46 \cos \left (\frac {3}{2} (e+f x)\right )-54 \cos \left (\frac {5}{2} (e+f x)\right )-36 \sin \left (\frac {1}{2} (e+f x)\right )-63 \log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (e+f x)+63 \log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (e+f x)-46 \sin \left (\frac {3}{2} (e+f x)\right )+54 \sin \left (\frac {5}{2} (e+f x)\right )+21 \log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (3 (e+f x))-21 \log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin (3 (e+f x))\right )}{24 f \left (\csc ^2\left (\frac {1}{4} (e+f x)\right )-\sec ^2\left (\frac {1}{4} (e+f x)\right )\right )^3 \sqrt {a (1+\sin (e+f x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.27, size = 144, normalized size = 1.07
method | result | size |
default | \(\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (-21 \arctanh \left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}}{\sqrt {a}}\right ) \left (\sin ^{3}\left (f x +e \right )\right ) a^{3}+27 \left (-a \left (\sin \left (f x +e \right )-1\right )\right )^{\frac {5}{2}} \sqrt {a}-56 \left (-a \left (\sin \left (f x +e \right )-1\right )\right )^{\frac {3}{2}} a^{\frac {3}{2}}+21 \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, a^{\frac {5}{2}}\right )}{24 \sin \left (f x +e \right )^{3} a^{\frac {7}{2}} \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(144\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 404 vs.
\(2 (125) = 250\).
time = 0.38, size = 404, normalized size = 2.99 \begin {gather*} \frac {21 \, {\left (\cos \left (f x + e\right )^{4} - 2 \, \cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} - \cos \left (f x + e\right ) - 1\right )} \sin \left (f x + e\right ) + 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} - 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) - 4 \, {\left (27 \, \cos \left (f x + e\right )^{3} + 25 \, \cos \left (f x + e\right )^{2} - {\left (27 \, \cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) - 17\right )} \sin \left (f x + e\right ) - 19 \, \cos \left (f x + e\right ) - 17\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{96 \, {\left (a f \cos \left (f x + e\right )^{4} - 2 \, a f \cos \left (f x + e\right )^{2} + a f - {\left (a f \cos \left (f x + e\right )^{3} + a f \cos \left (f x + e\right )^{2} - a f \cos \left (f x + e\right ) - a f\right )} \sin \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{4}{\left (e + f x \right )}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\mathrm {cot}\left (e+f\,x\right )}^4}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________